package com.sky.aware;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.stereotype.Component;

@Component
public class Student implements BeanNameAware, BeanClassLoaderAware, BeanFactoryAware {
    // beanClassloaderAware接口，可以获取到bean的类加载器
    @Override
    public void setBeanClassLoader(ClassLoader classLoader) {
        System.out.println("Student....setBeanClassLoader....."+ classLoader);
    }
    // beanFactoryAware接口，可以获取到bean工厂
    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        System.out.println("Student....setBeanFactory....."+ beanFactory);

    }

    // beanNameAware接口，可以获取到bean的名字
    @Override
    public void setBeanName(String name) {
        System.out.println("Student....setBeanName....."+ name);

    }
}
